{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Using config: {'_model_dir': '/Users/vijay/bert/model_checkpoints', '_tf_random_seed': None, '_save_summary_steps': 100, '_save_checkpoints_steps': None, '_save_checkpoints_secs': 600, '_session_config': allow_soft_placement: true\n",
      "graph_options {\n",
      "  rewrite_options {\n",
      "    meta_optimizer_iterations: ONE\n",
      "  }\n",
      "}\n",
      ", '_keep_checkpoint_max': 5, '_keep_checkpoint_every_n_hours': 10000, '_log_step_count_steps': 100, '_train_distribute': None, '_device_fn': None, '_protocol': None, '_eval_distribute': None, '_experimental_distribute': None, '_service': None, '_cluster_spec': <tensorflow.python.training.server_lib.ClusterSpec object at 0x123cc0d30>, '_task_type': 'worker', '_task_id': 0, '_global_id_in_cluster': 0, '_master': '', '_evaluation_master': '', '_is_chief': True, '_num_ps_replicas': 0, '_num_worker_replicas': 1}\n"
     ]
    }
   ],
   "source": [
    "# Setup task specific model and TPU running config.\n",
    "import modeling\n",
    "import optimization\n",
    "import run_classifier\n",
    "import tokenization\n",
    "import os\n",
    "import tensorflow as tf\n",
    "import datetime\n",
    "import json\n",
    "import pprint\n",
    "import random\n",
    "import string\n",
    "import sys\n",
    "\n",
    "#BERT_PRETRAINED_DIR = '/Users/vijay/Desktop/uncased_L-24_H-1024_A-16'\n",
    "BERT_PRETRAINED_DIR = '/Users/vijay/Downloads/uncased_L-12_H-768_A-12'\n",
    "\n",
    "#BERT_MODEL = 'uncased_L-12_H-768_A-16'\n",
    "BERT_MODEL = 'uncased_L-12_H-768_A-12'\n",
    "\n",
    "TASK_DATA_DIR = '/Users/vijay/bert/imdb_dataset'\n",
    "TASK = 'imdb'\n",
    "\n",
    "# Model Hyper Parameters\n",
    "TRAIN_BATCH_SIZE = 32\n",
    "EVAL_BATCH_SIZE = 8\n",
    "LEARNING_RATE = 2e-5\n",
    "NUM_TRAIN_EPOCHS = 3.0\n",
    "WARMUP_PROPORTION = 0.1\n",
    "MAX_SEQ_LENGTH = 128\n",
    "# Model configs\n",
    "SAVE_CHECKPOINTS_STEPS = 1000\n",
    "ITERATIONS_PER_LOOP = 1000\n",
    "NUM_TPU_CORES = 8\n",
    "VOCAB_FILE = os.path.join(BERT_PRETRAINED_DIR, 'vocab.txt')\n",
    "CONFIG_FILE = os.path.join(BERT_PRETRAINED_DIR, 'bert_config.json')\n",
    "INIT_CHECKPOINT = os.path.join(BERT_PRETRAINED_DIR, 'bert_model.ckpt')\n",
    "DO_LOWER_CASE = BERT_MODEL.startswith('uncased')\n",
    "\n",
    "processors = {\n",
    "  \"cola\": run_classifier.ColaProcessor,\n",
    "  \"mnli\": run_classifier.MnliProcessor,\n",
    "  \"mrpc\": run_classifier.MrpcProcessor,\n",
    "  \"imdb\": run_classifier.ImdbProcessor\n",
    "}\n",
    "processor = processors[TASK.lower()]()\n",
    "label_list = processor.get_labels()\n",
    "tokenizer = tokenization.FullTokenizer(vocab_file=VOCAB_FILE, do_lower_case=DO_LOWER_CASE)\n",
    "train_examples = processor.get_dev_examples(TASK_DATA_DIR)\n",
    "\n",
    "# tpu_cluster_resolver = tf.contrib.cluster_resolver.TPUClusterResolver(TPU_ADDRESS)\n",
    "# run_config = tf.contrib.tpu.RunConfig(\n",
    "#     cluster=tpu_cluster_resolver,\n",
    "#     model_dir=OUTPUT_DIR,\n",
    "#     save_checkpoints_steps=SAVE_CHECKPOINTS_STEPS,\n",
    "#     tpu_config=tf.contrib.tpu.TPUConfig(\n",
    "#         iterations_per_loop=ITERATIONS_PER_LOOP,\n",
    "#         num_shards=NUM_TPU_CORES,\n",
    "#         per_host_input_for_training=tf.contrib.tpu.InputPipelineConfig.PER_HOST_V2))\n",
    "\n",
    "\n",
    "run_config = tf.estimator.RunConfig(\n",
    "    model_dir='/Users/vijay/bert/model_checkpoints',\n",
    "    tf_random_seed=None,\n",
    "    save_summary_steps=100,\n",
    "    session_config=None,\n",
    "    keep_checkpoint_max=5,\n",
    "    keep_checkpoint_every_n_hours=10000,\n",
    "    log_step_count_steps=100,\n",
    "    train_distribute=None,\n",
    "    device_fn=None,\n",
    "    protocol=None,\n",
    "    eval_distribute=None,\n",
    "    experimental_distribute=None)\n",
    "\n",
    "num_train_steps = int(\n",
    "    len(train_examples) / TRAIN_BATCH_SIZE * NUM_TRAIN_EPOCHS)\n",
    "num_warmup_steps = int(num_train_steps * WARMUP_PROPORTION)\n",
    "\n",
    "model_fn = run_classifier.model_fn_builder_cpu(\n",
    "    bert_config=modeling.BertConfig.from_json_file(CONFIG_FILE),\n",
    "    num_labels=len(label_list),\n",
    "    init_checkpoint=INIT_CHECKPOINT,\n",
    "    learning_rate=LEARNING_RATE,\n",
    "    num_train_steps=num_train_steps,\n",
    "    num_warmup_steps=num_warmup_steps,\n",
    "    use_tpu=False,\n",
    "    use_one_hot_embeddings=True)\n",
    "\n",
    "# estimator = tf.contrib.tpu.TPUEstimator(\n",
    "#     use_tpu=False,\n",
    "#     model_fn=model_fn,\n",
    "#     config=run_config,\n",
    "#     train_batch_size=TRAIN_BATCH_SIZE,\n",
    "#     eval_batch_size=EVAL_BATCH_SIZE)\n",
    "\n",
    "estimator = tf.estimator.Estimator(\n",
    "    model_fn=model_fn,\n",
    "    config=run_config,\n",
    "    params={\n",
    "        'batch_size': TRAIN_BATCH_SIZE\n",
    "    })"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:Writing example 0 of 5000\n",
      "INFO:tensorflow:*** Example ***\n",
      "INFO:tensorflow:guid: dev-1\n",
      "INFO:tensorflow:tokens: [CLS] \" i just watched it . a couple of laughs , but nothing to write home about . jason lee looked like he was having fun . the ( long ) dvd gag reel consists almost solely of him having fits of un ##con ##tro ##lla ##ble laughter . selma blair seemed to be punching a time clock , but then again , her character was supposed to be a stick in the mud , so \\ well done \\ \" \" i guess ? jim bro ##lin was surprisingly funny . ( being married to ba ##bs can ' t be a picnic . ) the soundtrack was hip , and eclectic . larry miller , who played julia stil ##es father ( hilarious ##ly [SEP]\n",
      "INFO:tensorflow:input_ids: 101 1000 1045 2074 3427 2009 1012 1037 3232 1997 11680 1010 2021 2498 2000 4339 2188 2055 1012 4463 3389 2246 2066 2002 2001 2383 4569 1012 1996 1006 2146 1007 4966 18201 15934 3774 2471 9578 1997 2032 2383 16142 1997 4895 8663 13181 4571 3468 7239 1012 28112 10503 2790 2000 2022 19477 1037 2051 5119 1010 2021 2059 2153 1010 2014 2839 2001 4011 2000 2022 1037 6293 1999 1996 8494 1010 2061 1032 2092 2589 1032 1000 1000 1045 3984 1029 3958 22953 4115 2001 10889 6057 1012 1006 2108 2496 2000 8670 5910 2064 1005 1056 2022 1037 12695 1012 1007 1996 6050 2001 5099 1010 1998 20551 1012 6554 4679 1010 2040 2209 6423 25931 2229 2269 1006 26316 2135 102\n",
      "INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n",
      "INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:label: 0 (id = 0)\n",
      "INFO:tensorflow:*** Example ***\n",
      "INFO:tensorflow:guid: dev-2\n",
      "INFO:tensorflow:tokens: [CLS] \" while to most people watching the movie , this will be of little interest , but out of the many hundreds of movies dealing with magic and the occult in one form or another , this one is probably the best in many ways . < br / > < br / > from the go ##lem to the craft the subject seems to be of endless interest to the movie industry . the majority of movies which touch on it in any way do so childish ##ly ( for example \\ witch ##board \\ \" \" , a true piece of utter garbage in every way ) either taking the trans ##cend ##ental elements as cheap excuses for che ##es ##y special effects or [SEP]\n",
      "INFO:tensorflow:input_ids: 101 1000 2096 2000 2087 2111 3666 1996 3185 1010 2023 2097 2022 1997 2210 3037 1010 2021 2041 1997 1996 2116 5606 1997 5691 7149 2007 3894 1998 1996 27906 1999 2028 2433 2030 2178 1010 2023 2028 2003 2763 1996 2190 1999 2116 3971 1012 1026 7987 1013 1028 1026 7987 1013 1028 2013 1996 2175 16930 2000 1996 7477 1996 3395 3849 2000 2022 1997 10866 3037 2000 1996 3185 3068 1012 1996 3484 1997 5691 2029 3543 2006 2009 1999 2151 2126 2079 2061 24282 2135 1006 2005 2742 1032 6965 6277 1032 1000 1000 1010 1037 2995 3538 1997 14395 13044 1999 2296 2126 1007 2593 2635 1996 9099 23865 21050 3787 2004 10036 21917 2005 18178 2229 2100 2569 3896 2030 102\n",
      "INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n",
      "INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:label: 1 (id = 1)\n",
      "INFO:tensorflow:*** Example ***\n",
      "INFO:tensorflow:guid: dev-3\n",
      "INFO:tensorflow:tokens: [CLS] \" i was so glad i came across this short film . i ' m always so disappointed that short films are hard to come across , so when i saw this and saw that it was nominated for the live action short film at the academy awards , i was so pleased that i actually had a film that i was root ##ing for . < br / > < br / > the plot is pretty simple , the director , writer , and star na ##cho vi ##gal ##ond ##o tried coming up with a reason people would suddenly break out into a song and dance number like they do in movie musicals . the result is extremely entertaining and the song is [SEP]\n",
      "INFO:tensorflow:input_ids: 101 1000 1045 2001 2061 5580 1045 2234 2408 2023 2460 2143 1012 1045 1005 1049 2467 2061 9364 2008 2460 3152 2024 2524 2000 2272 2408 1010 2061 2043 1045 2387 2023 1998 2387 2008 2009 2001 4222 2005 1996 2444 2895 2460 2143 2012 1996 2914 2982 1010 1045 2001 2061 7537 2008 1045 2941 2018 1037 2143 2008 1045 2001 7117 2075 2005 1012 1026 7987 1013 1028 1026 7987 1013 1028 1996 5436 2003 3492 3722 1010 1996 2472 1010 3213 1010 1998 2732 6583 9905 6819 9692 15422 2080 2699 2746 2039 2007 1037 3114 2111 2052 3402 3338 2041 2046 1037 2299 1998 3153 2193 2066 2027 2079 1999 3185 20103 1012 1996 2765 2003 5186 14036 1998 1996 2299 2003 102\n",
      "INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n",
      "INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:label: 1 (id = 1)\n",
      "INFO:tensorflow:*** Example ***\n",
      "INFO:tensorflow:guid: dev-4\n",
      "INFO:tensorflow:tokens: [CLS] \" the creators of south park in their own film here , this is a brilliant film with a huge entertainment factor . if you like naked gun films and are not young and not too mature or serious on your humor , you ' ll love this . \" [SEP]\n",
      "INFO:tensorflow:input_ids: 101 1000 1996 17277 1997 2148 2380 1999 2037 2219 2143 2182 1010 2023 2003 1037 8235 2143 2007 1037 4121 4024 5387 1012 2065 2017 2066 6248 3282 3152 1998 2024 2025 2402 1998 2025 2205 9677 2030 3809 2006 2115 8562 1010 2017 1005 2222 2293 2023 1012 1000 102 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:label: 1 (id = 1)\n",
      "INFO:tensorflow:*** Example ***\n",
      "INFO:tensorflow:guid: dev-5\n",
      "INFO:tensorflow:tokens: [CLS] \" un ##sp ##eak ##ably disco ##mbo ##bula ##ted turkey , a mix of anti - nazi musical ( ! ! ) , pre - war americana and agatha christie who ##dun ##it sp ##oof with one big , big problem : it ' s deadly un ##fu ##nn ##y . besides the single - digit i . q . plot and dial ##og , the most amazing aspect of \\ lady . . . \\ \" \" is the be ##rse ##rk casting . gene wilder ( star and co - writer ) tries hard at it all : he plays a romantic lead ( with his looks ! ! and his age ! ! he and woody allen should start a club for clue [SEP]\n",
      "INFO:tensorflow:input_ids: 101 1000 4895 13102 25508 8231 12532 13344 28507 3064 4977 1010 1037 4666 1997 3424 1011 6394 3315 1006 999 999 1007 1010 3653 1011 2162 25988 1998 23863 13144 2040 27584 4183 11867 21511 2007 2028 2502 1010 2502 3291 1024 2009 1005 1055 9252 4895 11263 10695 2100 1012 4661 1996 2309 1011 15340 1045 1012 1053 1012 5436 1998 13764 8649 1010 1996 2087 6429 7814 1997 1032 3203 1012 1012 1012 1032 1000 1000 2003 1996 2022 22573 8024 9179 1012 4962 18463 1006 2732 1998 2522 1011 3213 1007 5363 2524 2012 2009 2035 1024 2002 3248 1037 6298 2599 1006 2007 2010 3504 999 999 1998 2010 2287 999 999 2002 1998 13703 5297 2323 2707 1037 2252 2005 9789 102\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:tensorflow:input_mask: 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n",
      "INFO:tensorflow:segment_ids: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n",
      "INFO:tensorflow:label: 0 (id = 0)\n",
      "***** Started training at 2018-11-14 20:45:35.970617 *****\n",
      "  Num examples = 5000\n",
      "  Batch size = 32\n",
      "INFO:tensorflow:  Num steps = 468\n",
      "INFO:tensorflow:Calling model_fn.\n",
      "INFO:tensorflow:*** Features ***\n",
      "INFO:tensorflow:  name = input_ids, shape = (32, 128)\n",
      "INFO:tensorflow:  name = input_mask, shape = (32, 128)\n",
      "INFO:tensorflow:  name = label_ids, shape = (32,)\n",
      "INFO:tensorflow:  name = segment_ids, shape = (32, 128)\n"
     ]
    }
   ],
   "source": [
    "train_features = run_classifier.convert_examples_to_features(\n",
    "    train_examples, label_list, MAX_SEQ_LENGTH, tokenizer)\n",
    "print('***** Started training at {} *****'.format(datetime.datetime.now()))\n",
    "print('  Num examples = {}'.format(len(train_examples)))\n",
    "print('  Batch size = {}'.format(TRAIN_BATCH_SIZE))\n",
    "tf.logging.info(\"  Num steps = %d\", num_train_steps)\n",
    "train_input_fn = run_classifier.input_fn_builder(\n",
    "    features=train_features,\n",
    "    seq_length=MAX_SEQ_LENGTH,\n",
    "    is_training=True,\n",
    "    drop_remainder=True)\n",
    "estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)\n",
    "print('***** Finished training at {} *****'.format(datetime.datetime.now()))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'pandas'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-2-1085f00949c9>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mpandas\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      3\u001b[0m \u001b[0mdf\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpandas\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread_csv\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'/Users/vijay/Downloads/labeledTrainData.tsv'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msep\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'\\t'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pandas'"
     ]
    }
   ],
   "source": [
    "import pandas\n",
    "\n",
    "df = pandas.read_csv('/Users/vijay/Downloads/labeledTrainData.tsv', sep='\\t')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
